<div class="box">
    <div class="heading">
        <h1><img alt="" src="<?php echo base_url('assets/admin/images/category.png'); ?>">Edit State</h1>

        <div class="buttons">
            <a class="button" href="#" onClick="$('#form').submit();"><span>Save</span></a>
            <a class="button" href="<?php echo base_url(ADMIN_PATH . '/setting/states'); ?>"><span>Cancel</span></a>
        </div>
    </div>
    <div class="content">

        <?php echo form_open(null, 'id="form"')?>

        <div class="form">
            <div>
                <?php echo form_label('State Name:', 'name')?>
                <?php echo form_input(array('name' => 'name', 'value' => set_value('name',$states['name'])))?>
            </div>
			<div>
                <?php echo form_label('State Code:', 'code')?>
                <?php echo form_input(array('name' => 'code', 'value' => set_value('code', $states['code'])))?>
            </div>
			<div>
                <?php echo form_label('Country:', 'country_id')?>
                <select name="country_id">
					<?php foreach ($countries as $country) { ?>
						<?php if ($country['country_id'] == $states['country_id']) { ?>
						<option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
						<?php } else { ?>
						<option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
						<?php } ?>
					
					<?php } ?>
				</select>
            </div>
			
			<div>
				<?php echo form_label('<span class="required">*</span> Status:', 'status'); ?>
				<?php echo form_dropdown('status', array('1'=>'Enable', '0' => 'Disable'), set_value('status',isset($states['status']) ? $states['status'] : ''), 'id=\'status\'')?>
			</div>
			
        </div>

        <div class="clear"></div>

        <?php echo form_close(); ?>
    </div>
</div>
